<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>请假申请</title>
<meta name="description" content="请假管理系统">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />

	
<script type="text/javascript">
		function validate() {
		    var l_s_card = document.getElementById('l_s_card').value;
			var s_username = document.getElementById('s_username').value;
			var g_name = document.getElementById('g_name').value;
			var c_name = document.getElementById('c_name').value;
			var s_phone = document.getElementById('s_phone').value;
			var l_begintime = document.getElementById('l_begintime').value;
			var l_endtime = document.getElementById('l_endtime').value;
			var l_address = document.getElementById('l_address').value;
			var l_cause = document.getElementById('l_cause').value;
			
			if (l_s_card == '') {
				document.getElementById('state').innerHTML = '学号未填写';
				return false;
			}
			if (s_username == ''){
	            document.getElementById('state1').innerHTML = '姓名未填写';
	            return false;
	        }
			if (g_name == ''){
	            document.getElementById('state2').innerHTML = '级别未填写';
	            return false;
	        }
			if (c_name == ''){
	            document.getElementById('state3').innerHTML = '班级未填写';
	            return false;
	        }
			if (s_phone == ''){
	            document.getElementById('state4').innerHTML = '手机号未填写';
	            return false;
	        } 
			if (l_begintime == '') {
				document.getElementById('state5').innerHTML = '开始时间未选择';
				return false;
			}
			if (l_endtime == '') {
				document.getElementById('state6').innerHTML = '结束时间未选择';
				return false;
			} 
			if (l_address == '') {
				document.getElementById('state7').innerHTML = '前往地点未填写';
				return false;
			} 
			if (l_cause == '') {
				document.getElementById('state8').innerHTML = '请假原因未填写';
				return false;
			} 
			
			document.getElementById('my_form').submit();


		}
	</script>
</head>

<body data-type="generalComponents">
	<jsp:include page="/common/head.jsp"></jsp:include>
	<jsp:include page="/WEB-INF/jsp/student/student_menu.jsp"></jsp:include>

	<div class="tpl-content-wrapper">
		<div class="tpl-portlet-components">
			<div class="portlet-title">
				<div class="caption font-green bold">
					<span class="am-icon-code"></span> 申请假条
				</div>
				<div class="tpl-portlet-input tpl-fz-ml">
					<div class="portlet-input input-small input-inline">
						<div class="input-icon right">
							<input type="hidden" class="form-control form-control-solid"
								placeholder="搜索...">
						</div>
					</div>
				</div>
			</div>
			<div class="tpl-block ">
				<div class="am-g tpl-amazeui-form">
					<div class="am-u-sm-12 am-u-md-9">
					
						<form class="am-form am-form-horizontal" method="post"
							id="my_form" action="ApplyServlet?method=Leave_Apply">
							<div class="am-form-group">
								<label class="am-u-sm-3 am-form-label"></label>
							</div>
							
							<div class="am-form-group">
								<label for="l_s_card" class="am-u-sm-3 am-form-label">学号</label>
								<div class="am-u-sm-9">
									<input type="text" name="l_s_card" id="l_s_card" value=""
										placeholder="请输入学号"> <small id="state"></small>
										
								</div>
							</div>
							<input type="hidden" value="1" name="flag">
							
							 <div class="am-form-group">
                                    <label for="s_username" class="am-u-sm-3 am-form-label">姓名</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" name="s_username" id="s_username" placeholder="输入姓名">
                                        <small id="state1"></small>
                                    </div>
                             </div>
                                
                       	     <div class="am-form-group">
                                    <label for="g_name" class="am-u-sm-3 am-form-label">级别</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" name="g_name" id="g_name" placeholder="请输入级别,例如2015,2016">
                                        <small id="state2"></small>
                                    </div>
                             </div> 
                             
                             <div class="am-form-group">
                                    <label for="c_name" class="am-u-sm-3 am-form-label">班级</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" name="c_name" id="c_name" placeholder="请输入班级名称">
                                        <small id="state3"></small>
                                    </div>
                             </div>
							
							<div class="am-form-group">
                                    <label for="s_phone" class="am-u-sm-3 am-form-label">手机号</label>
                                    <div class="am-u-sm-9">
                                        <input type="tel" name="s_phone" id="s_phone" placeholder="输入手机号">
                                        <small id="state4"></small>
                                    </div>
                            </div>
							
							<div class="am-form-group">
								<label for="l_begintime" class="am-u-sm-3 am-form-label">开始时间
									<span class="tpl-form-line-small-title"></span>
								</label>
								<div class="am-u-sm-9">
									<input type="text" name="l_begintime" id="l_begintime" value=""
										class="am-form-field tpl-form-no-bg" placeholder="开始时间"
										data-am-datepicker="" /> <small id="state5"></small>
								</div>
							</div>
							
							<div class="am-form-group">
								<label for="l_endtime" class="am-u-sm-3 am-form-label">结束时间
									<span class="tpl-form-line-small-title"></span>
								</label>
								<div class="am-u-sm-9">
									<input type="text" name="l_endtime" id="l_endtime" value=""
										class="am-form-field tpl-form-no-bg" placeholder="结束时间"
										data-am-datepicker="" /> <small id="state6"></small>
								</div>
							</div>
							<div class="am-form-group">
								<label for="l_address" class="am-u-sm-3 am-form-label">前往地点</label>
								<div class="am-u-sm-9">
									<input type="text" name="l_address" id="l_address" value=""
										placeholder="输入请假去往地点"><small id="state7"></small>
								</div>
							</div>
							<div class="am-form-group">
								<label for="l_cause" class="am-u-sm-3 am-form-label">请假原因</label>
								<div class="am-u-sm-9">
									<textarea class="" name="l_cause" rows="5" id="l_cause"
										placeholder="输入请假原因"></textarea>
									<small id="state8"></small>
								</div>
							</div>
							<div class="am-form-group">
								<div class="am-u-sm-9 am-u-sm-push-3">
									<button type="button" class="am-btn am-btn-primary"
										onclick="validate()">提交假条</button>
								</div>
							</div>
						</form>
						
					</div>
				</div>
			</div>

		</div>

	</div>





</body>

</html>